/*  
     PlAr is Platform Arena: a 2D multiplayer shooting game
     Copyright (C) 2009 Ragagnin Antonio <spocchio@gmail.com>
     
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
package plar.core;

import java.util.ArrayList;
import java.util.HashMap;

import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;

import plar.core.Action;
import plar.core.Common;
import plar.core.Element;
import plar.core.Level;

import plar.core.Parameters;
import plar.core.Sprite;



public class Player extends Element {

	
	
	Parameters info;

	
	public ArrayList<Gun>  gl;
	public Player() {
		super();
		
		setProperty("energy", new Integer(0));
		setProperty("type", "player");
		setProperty("isRunnable", true);
		setProperty("name", "player");
		setProperty("user", "");
		setStaticSprite("res/player.png");
		setProperty("friction",2f);
		setProperty("isStatic", false);
		setProperty("jumpSpeed", new Float(13f));
		setProperty("runSpeed", new Float(6.5f));
		setProperty("speedLimit", new Vec2(6.5f,8f));
		setProperty("airySpeed", new Float(0.2f));
		setProperty("linearDamping", 2f);
		
		setProperty("isFiring", false);
		setProperty("isRunning", false);
		setProperty("canCollide", true);
		setProperty("direction", 0.0);
		setProperty("bodyType",Body.e_dynamicType);
		setSize(0.3f, 0.7f);
		setProperty("reducedSize", new Vec2(0.3f,0.35f));
        setProperty("standardSize", new Vec2(0.3f,0.7f));
        
		
		
		actions.addAction("born", new Born());
		actions.addAction("input", new Input(this));
		info = new Parameters();
		info.put("me", this);
		info.put("subAction", "main");
		
		

		gl = new ArrayList<Gun>();
		setProperty("gunList", gl);


	}



public void setCurrentGun(Integer i)
	{
		
		setProperty("currentGun", i);

	}
	public int getCurrentGun()
	{
		return (Integer)getProperty("currentGun");

	}	
	
	
	public void run() {
		super.run();
		//Common.info(9, "Player.run() theta:"+body.getAngle());
		// actions.runAll(stdinfo);

	}



}
